<style lang="less" scoped>
    @import '../../../styles/common.less';
    @import '../../../styles/loading.less';
    @import 'audit.less';
</style>
<script src="./audit.js"></script>

<template>
    <div>
        <Row style="font-size: 15px;">
            机构名称：<Input v-model="query.orgName" clearable style="width: 15%"></Input>
            联系人：<Input v-model="query.orgContacts" clearable style="width: 15%"></Input>
            联系电话：<Input v-model="query.orgPhone" clearable style="width: 15%"></Input>
            状态：<Select v-model="query.type" style="width:8%" filterable clearable>
                        <Option :value=1>待审核</Option>
                        <Option :value=2>已审核</Option>
                    </Select>
            <span @click="loadList"><Button type="primary" icon="android-search">查询</Button></span>
            <span @click="refresh"><Button type="primary" icon="refresh">清空</Button></span>
        </Row>
        <div class="main-table">
            <Table border :columns="columns" :data="data"></Table>
        </div>
        <div class="pagination">
            <Page :total="total" size="small" :page-size="pageSize" :current.sync="pageIndex" @on-change="loadList"
                  show-total show-elevator></Page>
        </div>
        <Modal
                v-model="viewModal"
                title="机构信息"
                @on-ok="viewModa = false"
                @on-cancel="viewModal = false"
                :mask-closable="false"
                width="40%">
            <Form :model="formData" :label-width="70">
                <FormItem label="机构名称">
                    <Input v-model="formData.orgName" clearable></Input>
                </FormItem>
                <FormItem label="联系人">
                    <Input v-model="formData.orgContacts" clearable></Input>
                </FormItem>
                <FormItem label="联系电话">
                    <Input v-model="formData.orgPhone" clearable></Input>
                </FormItem>
                <FormItem label="地址">
                    <Input v-model="formData.orgAddress" clearable></Input>
                </FormItem>
                <FormItem label="缴费套餐">
                    <Row>
                        <Col span="21">
                        <Select v-model="formData.chargeid" filterable clearable>
                            <Option v-for="item in chargeList" :value="item.id" :key="item.id">{{ item.name }}</Option>
                        </Select>
                        </Col>
                        <Col span="3" style="text-align: right">
                        <a v-if="formData.chargeid" @click="chargeDetail">查看套餐</a>
                        </Col>
                    </Row>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button type="primary" @click="save">保存</Button>
                <Button type="ghost" style="margin-left: 8px" @click="viewModal = false">取消</Button>
            </div>
        </Modal>
        <Modal v-model="prizesModal"
               title="颁布奖状"
               width="60%"
               :mask-closable="false"
               @on-cancel="prizesModal = false">
            <div class="main-table">
                <Table border :columns="prizesColumns" :data="prizesData"></Table>
            </div>
            <div class="pagination">
                <Page :total="prizesTotal" size="small" :page-size="prizesSize" :current.sync="prizesIndex" @on-change="prizesSelect"
                      show-total show-elevator></Page>
            </div>
        </Modal>
        <Modal
                v-model="chargeModel"
                title="套餐信息"
                @on-ok="chargeModel = false"
                @on-cancel="chargeModel = false"
                :mask-closable="false"
                width="50%">
            <Form :model="chargeData" :label-width="90">
                <FormItem label="套餐名称">
                    <div class="conts">{{chargeData.name}}</div>
                </FormItem>
                <FormItem label="费用类型">
                    <div class="conts">{{chargeData.cost}}</div>
                </FormItem>
                <Row>
                    <Col span="12">
                    <FormItem label="免费主题数">
                        <div class="conts">{{chargeData.themesun}}</div>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="免费奖状数">
                        <div class="conts">{{chargeData.freediploma}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="主题费用">
                        <div class="conts">{{chargeData.themecost}}</div>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="奖状费用">
                        <div class="conts">{{chargeData.diplomacost}}</div>
                    </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span="12">
                    <FormItem label="下载数量">
                        <div class="conts">{{chargeData.teenagersun}}</div>
                    </FormItem>
                    </Col>
                    <Col span="12">
                    <FormItem label="下载收费标准">
                        <div class="conts">{{chargeData.rates}}</div>
                    </FormItem>
                    </Col>
                </Row>
            </Form>
        </Modal>
        <Modal v-model="prizeModal"
               title="奖状"
               @on-cancel="prizeModal = false">
            <img :src="imgpath" width="100%">
        </Modal>
    </div>
</template>
